package com.ryskoo.catering.productattr.domain;

import com.ryskoo.catering.productattrvalue.domain.ProductAttrValuePO;
import com.ryskoo.framework.core.bean.BasicPO;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * 商品非规格属性，目前对应菜品的口味（不辣，微辣，中辣）
 *
 * @author JackHou
 */
@Entity
@Table(name = "cater_product_attr")
public class ProductAttrPO extends BasicPO {
    /* 所属商品uuid */
    @Column(name = "product_uuid", columnDefinition = "char", length = 32)
    private String productUuid;
    /* 模板属性uuid */
    @Column(name = "template_attr_uuid", columnDefinition = "char", length = 32)
    private String templateAttrUuid;
    /* 属性名称 */
    @Column(name = "name", columnDefinition = "varchar", length = 20)
    private String name;
    /* 排序 */
    @Column(name = "position", columnDefinition = "int")
    private Integer position;

    /* 是否是规格属性 1-是；0-否 */
    @Column(name = "is_spec")
    private boolean isSpec = false;

    /* 是否启用 */
    @Transient
    private boolean status = true;

    @Transient
    private List<ProductAttrValuePO> productAttrValueList;

    public List<ProductAttrValuePO> getProductAttrValueList() {
        return productAttrValueList;
    }

    public void setProductAttrValueList(List<ProductAttrValuePO> productAttrValueList) {
        this.productAttrValueList = productAttrValueList;
    }

    public Integer getPosition() {
        return position;
    }

    public void setPosition(Integer position) {
        this.position = position;
    }

    public String getProductUuid() {
        return productUuid;
    }

    public void setProductUuid(String productUuid) {
        this.productUuid = productUuid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isSpec() {
        return isSpec;
    }

    public void setSpec(boolean spec) {
        isSpec = spec;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public String getTemplateAttrUuid() {
        return templateAttrUuid;
    }

    public void setTemplateAttrUuid(String templateAttrUuid) {
        this.templateAttrUuid = templateAttrUuid;
    }
}
